package 设计模式.h_组合模式;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 教育系统组合类
 * 
 * @author caihe
 * @date 2023/3/10 11:14
 */
public abstract class EduComposite {
    
    private final List<EduComposite> children= new ArrayList<>();

//    public EduComposite(EduComposite... composites) {
//        for (EduComposite composite : composites) {
//            composite.add(composite);
//        }
//    }

    public void add(EduComposite... edu) {
        children.addAll(Arrays.asList(edu));
    }
    
    public abstract void print();

    public List<EduComposite> getChildren() {
        return children;
    }
}
